/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Santiago.Escobar.M
 */
@Entity
@Table(name = "tipocombustible")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tipocombustible.findAll", query = "SELECT t FROM Tipocombustible t"),
    @NamedQuery(name = "Tipocombustible.findByIdtipocombustible", query = "SELECT t FROM Tipocombustible t WHERE t.idtipocombustible = :idtipocombustible"),
    @NamedQuery(name = "Tipocombustible.findByCombustible", query = "SELECT t FROM Tipocombustible t WHERE t.combustible = :combustible")})
public class Tipocombustible implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idtipocombustible")
    private Long idtipocombustible;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "combustible")
    private String combustible;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idtipoccombustible")
    private Collection<Recargacombustiblevehiculo> recargacombustiblevehiculoCollection;

    public Tipocombustible() {
    }

    public Tipocombustible(Long idtipocombustible) {
        this.idtipocombustible = idtipocombustible;
    }

    public Tipocombustible(Long idtipocombustible, String combustible) {
        this.idtipocombustible = idtipocombustible;
        this.combustible = combustible;
    }

    public Long getIdtipocombustible() {
        return idtipocombustible;
    }

    public void setIdtipocombustible(Long idtipocombustible) {
        this.idtipocombustible = idtipocombustible;
    }

    public String getCombustible() {
        return combustible;
    }

    public void setCombustible(String combustible) {
        this.combustible = combustible;
    }

    @XmlTransient
    public Collection<Recargacombustiblevehiculo> getRecargacombustiblevehiculoCollection() {
        return recargacombustiblevehiculoCollection;
    }

    public void setRecargacombustiblevehiculoCollection(Collection<Recargacombustiblevehiculo> recargacombustiblevehiculoCollection) {
        this.recargacombustiblevehiculoCollection = recargacombustiblevehiculoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtipocombustible != null ? idtipocombustible.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tipocombustible)) {
            return false;
        }
        Tipocombustible other = (Tipocombustible) object;
        if ((this.idtipocombustible == null && other.idtipocombustible != null) || (this.idtipocombustible != null && !this.idtipocombustible.equals(other.idtipocombustible))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.Tipocombustible[ idtipocombustible=" + idtipocombustible + " ]";
    }
    
}
